AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')

function ENT:Initialize()
	self.Entity:SetModel( self.DefaultModel )
	
	if self.Entity.DamageType == "normal" then
		self.Entity.Damage = 150
	else
		self.Entity.Damage = 350
	end
	
	self.Cooldown = 1
	self.EnergyDraw = 20000
	self.ProjectileName = "projectile_direct_light"
	self.ProjectileSpeed = 4000
	
	self.BaseClass.Initialize(self)
end

function ENT:DrawFireEffect()
	CDEffect_sprite_pulse(self.Entity:LocalToWorld(self.FireOrigin), self.Entity.Color, 100, 0.25, 6, self.Entity)
end

function Light_Pulse_Duplicate(player, position, angles, DamageType, Color)
	local newentity = ents.Create("weapon_projectile_direct_light")
	newentity:SetPos(position)
	newentity:SetAngles(angles)
	newentity:SetPlayer(player)
	newentity.DamageType = DamageType
	newentity.Color = Color
	newentity:Spawn()
	return newentity
end

duplicator.RegisterEntityClass("weapon_projectile_direct_light", Light_Pulse_Duplicate, "pos", "ang", "DamageType", "Color")